﻿#region Using Statements
using GameBase.Sounds;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
#endregion

namespace StarFox.Sounds
{
    /// <summary>
    /// Provides functionality for basic menu and gameplay sound management.
    /// </summary>
    public class ScreenSound : SoundManager, IScreenSound
    {
        #region Constructor

        /// <summary>
        /// Initializes a new instance of this class.
        /// </summary>
        /// <param name="contentPath">Path of XACT audio related content.</param>
        /// <param name="xactProjectName">XACT project file name - .xap</param>
        /// <param name="waveBankName">Wave bank name - .xwb</param>
        /// <param name="soundBankName">Sound bank name - .xsb</param>
        public ScreenSound(string contentPath, string xactProjectName, string waveBankName, string soundBankName)
            : base(contentPath, xactProjectName, waveBankName, soundBankName)
        {
        }

        #endregion

        #region Sound Configuration

        /// <summary>
        /// Sets the volume of all associated sounds.
        /// </summary>
        /// <param name="volume">Volume (0.0 -> silence - 1.0 -> full volume).</param>
        public void SetVolume(float volume)
        {
            SetGlobalVariable("Volume", volume);
        }

        #endregion

        #region PlayBack Methods

        #region IScreenSound

        /// <summary>
        /// Plays sound corresponding to "loop through menu items" action.
        /// </summary>
        public void Cursor()
        {
            PlayCue("MENU_CURSOR");
        }

        /// <summary>
        /// Plays sound corresponding to "accept" action.
        /// </summary>
        public void Accept()
        {
            PlayCue("MENU_ACCEPT");
        }

        /// <summary>
        /// Plays sound corresponding to "cancel" action.
        /// </summary>
        public void Cancel()
        {
            PlayCue("MENU_CANCEL");
        }

        /// <summary>
        /// Plays sound corresponding to "enter" action.
        /// </summary>
        public void Enter()
        {
            PlayCue("MENU_ENTER");
        }

        /// <summary>
        /// Plays sound corresponding to "scrolling along menu options" action.
        /// </summary>
        public void Scroll()
        {
            PlayCue("MENU_SCROLL");
        }

        /// <summary>
        /// Plays sound corresponding to "error selecting option value" action.
        /// </summary>
        public void Error()
        {
            PlayCue("MENU_ERROR");
        }

        /// <summary>
        /// Plays sound corresponding to "default menu item values" action.
        /// </summary>
        public void Default()
        {
            PlayCue("MENU_DEFAULT");
        }

        /// <summary>
        /// Plays sound corresponding to "pause game" action.
        /// </summary>
        public void Pause()
        {
            PlayCue("GAME_PAUSE");
        }

        /// <summary>
        /// Plays sound corresponding to "resume game" action.
        /// </summary>
        public void Resume()
        {
            PlayCue("GAME_RESUME");
        }

        /// <summary>
        /// Plays sound corresponding to "load game" action.
        /// </summary>
        public void LoadGame()
        {
            PlayCue("MENU_LOADGAME");
        }

        #endregion

        #region Introduction

        /// <summary>
        /// Plays sound corresponding to "PEGI_3" voice message.
        /// </summary>
        public void PEGI3()
        {
            PlayCue("PEGI_3");
        }

        /// <summary>
        /// Plays sound corresponding to "Dream, Build, Play" sound notification.
        /// </summary>
        public void DreamBuildPlay()
        {
            PlayCue("DREAM_BUILD_PLAY");
        }

        #endregion

        #endregion
    }
}
